// Copyright 2012 The Glue BSF Library Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS-IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/**
 * @fileoverview This is a base error view that will pop up if there is no view present.
 * 
 * TODO come up with a better way then editing the library to change the error view data. 
 */
goog.provide('glue.Error')

goog.require('glue.View');


goog.require('goog.dom');
goog.require('goog.Uri');

/**
 * Error view implementation
 * @extends {glue.View}
 * @constructor
 */
glue.Error = function(params){
	goog.base(this);	
	/** @type {goog.Uri.QueryData} */
	this.params_ = params;	
}
goog.inherits(glue.Error,glue.View);

/** 
 * @inheritDoc 
 */
glue.Error.prototype.ViewName = 'error';

/** @override */
glue.Error.prototype.decorateInternal = function(element){
	goog.base(this,'decorateInternal',element);
		
	goog.dom.appendChild(element,goog.dom.createDom('h4',{},'Error'))	
	goog.dom.appendChild(element,goog.dom.createDom('p',{'style':'color:red;font-weight:bolder;'},'Could not find type: '+this.params_.get('type','None')))
}
